<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>BadgerDB: badgerdb::FileIterator Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">BadgerDB
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacebadgerdb.html">badgerdb</a>      </li>
      <li class="navelem"><a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">badgerdb::FileIterator Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="badgerdb::FileIterator" -->
<p>Iterator for iterating over the pages in a file.  
 <a href="classbadgerdb_1_1_file_iterator.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>&gt;</code></p>

<p><a href="classbadgerdb_1_1_file_iterator-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a99bd5c0e0fac0493f9664409219ca88e">FileIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#ad286fc916be769b1bea154603b83ece0">FileIterator</a> (<a class="el" href="classbadgerdb_1_1_file.html">File</a> *file)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#afabd7eecd315a85f9eb602f71c6f88e3">FileIterator</a> (<a class="el" href="classbadgerdb_1_1_file.html">File</a> *file, <a class="el" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> page_number)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a6fa0f1cef8b46bb933ce6f000276ab52">operator++</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a997a4dc0a213e33384f82891135e41ec"></a><!-- doxytag: member="badgerdb::FileIterator::operator++" ref="a997a4dc0a213e33384f82891135e41ec" args="(int)" -->
<a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><b>operator++</b> (int)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a373f648963527f2dd259980434686645">operator==</a> (const <a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a> &amp;rhs) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e1a5e7e5c0b2cc2861e7b3bf856739a"></a><!-- doxytag: member="badgerdb::FileIterator::operator!=" ref="a9e1a5e7e5c0b2cc2861e7b3bf856739a" args="(const FileIterator &amp;rhs) const " -->
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a> &amp;rhs) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbadgerdb_1_1_page.html">Page</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a425810cc9834e0a3c97da76cd0a6b10a">operator*</a> () const </td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Iterator for iterating over the pages in a file. </p>
<p>This class provides a forward-only iterator for iterating over all of the pages in a file. </p>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00023">23</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a99bd5c0e0fac0493f9664409219ca88e"></a><!-- doxytag: member="badgerdb::FileIterator::FileIterator" ref="a99bd5c0e0fac0493f9664409219ca88e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a99bd5c0e0fac0493f9664409219ca88e">badgerdb::FileIterator::FileIterator</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs an empty iterator. </p>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00028">28</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">      : file_(NULL),
        current_page_number_(<a class="code" href="classbadgerdb_1_1_page.html#a785a1e756d47fb7f8f3603a3fe8ffcef">Page::INVALID_NUMBER</a>) {
  }
</pre></div>
</div>
</div>
<a class="anchor" id="ad286fc916be769b1bea154603b83ece0"></a><!-- doxytag: member="badgerdb::FileIterator::FileIterator" ref="ad286fc916be769b1bea154603b83ece0" args="(File *file)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a99bd5c0e0fac0493f9664409219ca88e">badgerdb::FileIterator::FileIterator</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbadgerdb_1_1_file.html">File</a> *&#160;</td>
          <td class="paramname"><em>file</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructors an iterator over the pages in a file, starting at the first page.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td><a class="el" href="classbadgerdb_1_1_file.html" title="Class which represents a file in the filesystem containing database pages.">File</a> to iterate over. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00039">39</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">      : file_(file) {
    assert(file_ != NULL);
    <span class="keyword">const</span> FileHeader&amp; header = file_-&gt;readHeader();
    current_page_number_ = header.first_used_page;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="afabd7eecd315a85f9eb602f71c6f88e3"></a><!-- doxytag: member="badgerdb::FileIterator::FileIterator" ref="afabd7eecd315a85f9eb602f71c6f88e3" args="(File *file, PageId page_number)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbadgerdb_1_1_file_iterator.html#a99bd5c0e0fac0493f9664409219ca88e">badgerdb::FileIterator::FileIterator</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbadgerdb_1_1_file.html">File</a> *&#160;</td>
          <td class="paramname"><em>file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a>&#160;</td>
          <td class="paramname"><em>page_number</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs an iterator over the pages in a file, starting at the given page number.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">file</td><td><a class="el" href="classbadgerdb_1_1_file.html" title="Class which represents a file in the filesystem containing database pages.">File</a> to iterate over. </td></tr>
    <tr><td class="paramname">page_number</td><td>Number of page to start iterator at. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00053">53</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">      : file_(file),
        current_page_number_(page_number) {
  }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a425810cc9834e0a3c97da76cd0a6b10a"></a><!-- doxytag: member="badgerdb::FileIterator::operator*" ref="a425810cc9834e0a3c97da76cd0a6b10a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbadgerdb_1_1_page.html">Page</a> badgerdb::FileIterator::operator* </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Dereferences the iterator, returning a copy of the current page in the file.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="classbadgerdb_1_1_page.html" title="Class which represents a fixed-size database page containing records.">Page</a> in file. </dd></dl>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00103">103</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">  { <span class="keywordflow">return</span> file_-&gt;<a class="code" href="classbadgerdb_1_1_file.html#aba4762b533499b7b7cc0774192ead27c">readPage</a>(current_page_number_); }
</pre></div>
</div>
</div>
<a class="anchor" id="a6fa0f1cef8b46bb933ce6f000276ab52"></a><!-- doxytag: member="badgerdb::FileIterator::operator++" ref="a6fa0f1cef8b46bb933ce6f000276ab52" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a>&amp; badgerdb::FileIterator::operator++ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Advances the iterator to the next page in the file. </p>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00061">61</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">                                    {
    assert(file_ != NULL);
    <span class="keyword">const</span> PageHeader&amp; header = file_-&gt;readPageHeader(current_page_number_);
    current_page_number_ = header.next_page_number;

    <span class="keywordflow">return</span> *<span class="keyword">this</span>;
  }
</pre></div>
</div>
</div>
<a class="anchor" id="a373f648963527f2dd259980434686645"></a><!-- doxytag: member="badgerdb::FileIterator::operator==" ref="a373f648963527f2dd259980434686645" args="(const FileIterator &amp;rhs) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool badgerdb::FileIterator::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classbadgerdb_1_1_file_iterator.html">FileIterator</a> &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns true if this iterator is equal to the given iterator.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>Iterator to compare against. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>True if other iterator is equal to this one. </dd></dl>

<p>Definition at line <a class="el" href="file__iterator_8h_source.html#l00087">87</a> of file <a class="el" href="file__iterator_8h_source.html">file_iterator.h</a>.</p>
<div class="fragment"><pre class="fragment">                                                        {
    <span class="keywordflow">return</span> file_-&gt;<a class="code" href="classbadgerdb_1_1_file.html#ac61ce3c2233fd1f7e2e2a8a5a7640936">filename</a>() == rhs.file_-&gt;filename() &amp;&amp;
        current_page_number_ == rhs.current_page_number_;
  }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>bufmgr/src/<a class="el" href="file__iterator_8h_source.html">file_iterator.h</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 14:17:57 for BadgerDB by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
